<?php
/*
 * Copyright notice
 * 
 * (c) 2009 MH-Dev.de, Martin Hesse <info@mh-dev.de>
 * 
 * This script is part of the MH-Dev.-Board project. The MH-Dev.-Board 
 * is free software; you can redistribute it and/or modify it under the 
 * terms of the GNU General Public License as published by 
 * the Free Software Foundation; either version 3 of the License, 
 * or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty 
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU 
 * General Public License along with this program; if not, 
 * see http://www.gnu.org/licenses/.
 */


/**
 * GetBoardTitle
 * 
 * View Helper to get the title of a board
 * 
 * @author	Martin Hesse <info@mh-dev.de>
 * @package	MH-Dev.-Board
 */
class MHDEV_View_Helper_GetBoardTitle extends Zend_View_Helper_Abstract
{
	/*
	 * Get the title of a board
	 * 
	 * @param int $board_uid
	 * 
	 * @return string title of the board
	 */
	public function GetBoardTitle($board_uid)
	{
		// db
		$boards 	= new Boards();
		
		// query
		$getBoard	= $boards->find($board_uid);
		
		if($getBoard->count() > 0)
		{
			$board	= $getBoard->toArray();
			return $board[0]['title'];
		}
		else
		{
			return 'Error';
		}
	}
}